-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
STY: ignore mypy errors #62482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STY: ignore mypy errors #62482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. When we have mypy
errors, we try to include text of the mypy error in a comment, so there is a few places where you need to add those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add mypy error in comments (both places)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pandas/core/algorithms.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be fixed as follows. (and you can remove the comments in 218-219). Move the return values
statement after line 220 where it says values = cls.from_sequence ...
and after line 223 the values = values.astype...
statement so that it is no longer at the end of the function.
If mypy
still complains on either statement, you need to have a comment in there with the mypy
error (as in lines 218-219)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know If I've done what you asked, but ended up having these errors:
pandas/core/algorithms.py:232: error: Incompatible return value type (got "ExtensionArray", expected "ndarray[tuple[Any, ...], dtype[Any]]") [return-value]
pandas/core/algorithms.py:234: error: Incompatible return value type (got "ndarray[tuple[Any, ...], dtype[Any]]", expected "ExtensionArray") [return-value]
Check if the changes are correct please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the comment here since you removed the ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Co-authored-by: Irv Lustig <irv@princeton.com>
Thanks @Alvaro-Kothe
Owee, I'm MrMeeseeks, Look at me.
There seem to be a conflict, please backport manually. Here are approximate instructions:
- Checkout backport branch and update it.
git checkout 2.3.x
git pull
- Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 e97a56e746f8cdeabf7e83ec83455cbf5386c909
- You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #62482: STY: ignore mypy errors'
- Push to a named branch:
git push YOURFORK 2.3.x:auto-backport-of-pr-62482-on-2.3.x
- Create a PR against branch 2.3.x, I would have named this PR:
"Backport PR #62482 on branch 2.3.x (STY: ignore mypy errors)"
And apply the correct labels and milestones.
Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!
Remember to remove the Still Needs Manual Backport
label once the PR gets merged.
If these instructions are inaccurate, feel free to suggest an improvement.
I don't believe backporting is required because branch 2.3.x does not use the latest version of NumPy.
Line 25 in 2ca088d
I don't believe backporting is required because branch 2.3.x does not use the latest version of NumPy.
I'll let @mroeschke comment here, but I think backporting may be required because the CI requires the latest version of numpy
. What I'm not sure of is if we run the code checks on the backported branch.
Indeed no need to backport (at the moment), the CI build on 2.3.x that runs linting is indeed pinned to numpy<2 as @Alvaro-Kothe mentions, so the typing errors are in general slightly different (and I don't think it is worth the effort to try to align that at this point)
Co-authored-by: Irv Lustig <irv@princeton.com>
Uh oh!
There was an error while loading. Please reload this page.
I think this will make the CI green again.
The errors are because of a new version of numpy:
Original errors